//
//  MovieCell.m
//  HuiWenMovie
//
//  Created by niceDay on 15/7/20.
//  Copyright (c) 2015年 computer. All rights reserved.
//

#import "MovieCell.h"

@implementation MovieCell

- (void)awakeFromNib {
    
    self.selectionStyle = UITableViewCellSelectionStyleNone;
}

- (void)setModal:(messageModal *)modal{
    _modal = modal;
    _starView = [[starView alloc] initWithFrame:CGRectMake(90, 30, 120, 25)];
     _starView.average  = modal.average;
    [self.contentView addSubview:_starView];
    [self setNeedsLayout];
}

- (void)layoutSubviews{
    self.backgroundColor = [UIColor blackColor];
    
    _title.text = _modal.title;
    _title.textColor = [UIColor yellowColor];
    _title.highlightedTextColor = [UIColor redColor];
    
    _year.text = [NSString stringWithFormat:@"年份 : %@",_modal.year];
    _year.textColor = [UIColor whiteColor];
    _year.highlightedTextColor = [UIColor redColor];
    
    _average.text = [NSString stringWithFormat:@"%.1f",_modal.average];
    _average.textColor = [UIColor whiteColor];
    _average.highlightedTextColor = [UIColor redColor];
   
    NSString *imageStr = _modal.images[@"small"];
    [self.iconImageView sd_setImageWithURL:[NSURL URLWithString:imageStr]];
 
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
